package domain;

import java.util.Arrays;
import java.util.List;
import domain.extra.OddEven;
import domain.extra.Result;

public class OddEvenBet extends Bet { // par impar
	private OddEven type; 
	private int chips; 

	public OddEvenBet() {
		super();
	}
	
	public OddEvenBet(OddEven type, int chips) {
		this.type= type; 
		this.chips= chips; 
	}
	
	@Override
	public int gain() {
		return (this.getCount()*2);
	}

	@Override
	public boolean win(Result r) {
		return this.type.equals(r.getOddEven());
	}
	
	public OddEven getType() {
		return type;
	}
	
	public void setType(OddEven type) {
		this.type = type;
	}

	@Override
	public List getOptions() {
		return Arrays.asList(OddEven.values());
	}
	
	@Override
	public String getDescription() {
		return "OddEvenBet";
	}

	@Override
	public void typeOption(Object type) {
		this.type= (OddEven) type;
	}
}
